audio_form object
This method returns a value indicating whether the specified control has been pressed.
bool is_pressed(int control_id)
Parameters:
control_id
The ID of the control you wish to check.
Return value:
true if the control has been pressed, false if the control has not been pressed or if an error occurred.
Remarks:
This method will only function on push buttons.
Once this method returns true, the button's push status is automatically reset so that the button may be reused.
Example:
// Make a simple form with a few buttons.
#include "form.bgt"
audio_form form;
void main()
{
form.create_window("Example Form", true);
int ok=form.create_button("OK");
int cancel=form.create_button("E&xit");
while(true)
{
form.monitor();
wait(5);
if(form.is_pressed(ok))
{
alert("Information", "The OK button has been pressed.");
exit();
}
if(form.is_pressed(cancel))
{
alert("Information", "The Cancel button has been pressed.");
exit();
}
if((key_down(KEY_LMENU))&&(key_pressed(KEY_F4)))
{
exit();
}
}
}